#ifndef COLORMAP_H
#define	COLORMAP_H

#include <rfftw.h>
#include <string>
#include <iostream>
#include <cmath>

class ColorMap
{
    public:
    
        enum ColorMode {BlackWhite, Rainbow, Banded, ColorModeCount};
        enum ScaleMode {AUTO, MANUAL};
    
    private:

        ColorMode d_scalar_col;
        ScaleMode d_scale;
        int d_levels;
        
        double d_min;
        double d_max;       
        double d_clampMin;
        double d_clampMax;
        
    
    public:
        ColorMap();
        void set(double vy);
        void mode(int mod);
        ColorMode mode();
        int levels();
        
        void minimum(fftw_real min);
        void maximum(fftw_real max);
        
        fftw_real minimum();
        fftw_real maximum();
        
        fftw_real usedMin();
        fftw_real usedMax();
        

    private:
        void rainbow(float value, float* R, float* G, float* B);   
    
};

inline void ColorMap::mode(int mod)
{
    d_scalar_col = ColorMode(mod);    
}

inline ColorMap::ColorMode ColorMap::mode()
{
    return d_scalar_col;
}

inline int ColorMap::levels()
{
    return d_levels;
}

inline void ColorMap::maximum(fftw_real max)
{
    d_max = max;
}

inline void ColorMap::minimum(fftw_real min)
{
    d_min = min;
}

inline fftw_real ColorMap::maximum()
{
    return d_max;
}

inline fftw_real ColorMap::minimum()
{
    return d_min;
}

void drawBitmapText(std::string const &str, double x, double y);

#endif	/* COLORMAP_H */

